home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Creative Computers
/
Creative Computers CD-ROM, Volume 1 (Legendary Design Technologies, Inc.)(1994).iso
/
shareware
/
telecom
/
ncomm
/
host
/
host.script
< prev
next >
Wrap
Text File
|
1994-11-17
|
18KB
|
698 lines
;*******************************************************
; NComm HOST SYSTEM
; Version 1.3 891117
;
; Copyright © 1989 Daniel Bloch
;*******************************************************
set $version= "1.3"
;--------------------------------------------
; Set these variables to fit your needs
;--------------------------------------------
set $dir = "NComm:host/" ;Directory for misc. files
set $uldir = "NComm:host/files/" ;Upload directory
set $dldir = "NComm:host/files/" ;Download directory
set $hold = "NComm:host/hold/" ;Hold directory
set $holdzoo= "t:HOLD.ZOO" ;Hold file
set $tmp = "t:NHS.tmp" ;Temporary file
set $passwd = "abc" ;User password
set $sysop = "Daniel Bloch" ;Sysop name
set $syspass= "xyz" ;Sysop password
set $sysname= "Dan's BBS" ;Name of system
set $list = "C:list" ;Directory lister
;All files in hold directory will be deleted at initialization!!!
;-------------------- M A I N P R O G R A M -----------------------;
message "\f" ;Clear screen
main: clrstack
gosub init ;Initialize various stuff
gosub connect ;Wait for RING and answer the phone
when "\r\nNO CARRIER\r\n" goto NoCarrier
gosub prelog ;Show opening picture
gosub login ;Get name & password
IF !$name == $sysop THEN goto user
set $sysacc = "TRUE"
IF $pass == $syspass THEN goto OK
send "Wrong!!\n"
write $dir"log" "\n"$date" Wrong password: "$pass"\n"
gosub logout
goto main
user: set $sysacc = "FALSE"
IF $pass == $passwd THEN goto OK
send "Wrong!\n"
write $dir"log" "\n"$date" "$name" Wrong password: "$pass"\n"
gosub login
IF $pass == $passwd THEN goto OK
send "Wrong!!\n"
write $dir"log" "\n"$date" "$name" Wrong password: "$pass"\n"
gosub logout
goto main
;User has logged in
OK: write $dir"log" "\n"$date" Login: "$name" ("$baud")\n"
gosub postlog
timeout 2
echo off
send "^[[97x"
input $id "\r"
echo on
timeout 300 goto bibi
send "\nPress [ENTER] to continue..."
input $dummy "\r"
send "\f"
ascsend $dir"menu0"
;This is the main loop
loop: gosub MainMenu
send "Are you sure you want to log off the system (Enter=Y)? "
input $cmd "\r"
IF $cmd == "N" THEN goto loop
send "\n"
gosub logout
goto main
;--------------------- S U B R O U T I N E S ----------------------
;********************************************************
;* Initialize the system
;********************************************************
init: config $dir"host.config"
hangup
set $sysacc = "FALSE"
echo off
dwhens
timeout 0
cli "delete >nil: "$hold"#?"
return
;********************************************************
;* Wait for CONNECT
;********************************************************
connect:
dwhens
send " \r"
gosub skip
conn0: message "\n\n\n"$sysname" [Press '?' for help]\n"
message "Waiting for caller...\n"
timeout 0
input $char "" ;Get one character
IF !$char == "?" THEN goto conn1
message "\n\nSpace = Local login (switch your modem off first!)\n"
message " Q = Quit NHS"
goto conn0
conn1: IF $char == "Q" THEN goto QuitNHS
IF $char == " " THEN goto Local
conn2: when "CONNECT 1200" goto conn1200
when "CONNECT 2400" goto conn2400
when "CONNECT 4800" goto conn4800
when "CONNECT 9600" goto conn9600
dtenths 7
send "ATA\n"
timeout 90 goto connect
wait "NO CARRIER"
goto connect
conn3: dwhens
timeout 0
echo on
gosub skip
return
Local: message "\nStarting local logon..."
goto conn3
QuitNHS:
config "NComm:NComm.config"
end
conn1200:
set $baud = "1200"
goto conn3
conn2400:
set $baud = "2400"
goto conn3
conn4800:
set $baud = "4800"
goto conn3
conn9600:
set $baud = "9600"
goto conn3
;********************************************************
;* Show "prelog", i.e. the picture to be shown before
;* login.
;********************************************************
prelog: send "\f"$sysname" ("$baud") up on "$date"\n"
send $NComm" / NComm Host System (NHS) v"$version"\n"
send "Copyright © 1989 Daniel Bloch\n\n\n"
ascsend $dir"prelog"
return
;********************************************************
;* Show "postlog", i.e. the picture to be shown after
;* login.
;********************************************************
postlog:
send "\n\n"
ascsend $dir"postlog"
; cli "cookie"
return
;********************************************************
;* Read user name and password into the variables
;* $name and $pass.
;********************************************************
Login: echo on
timeout 120 goto LogSleep
send "\n\nEnter your name: "
input $name "\r"
send "\nEnter your password: "
echo off
input $pass "\r"
echo on
timeout 0
send "\n"
return
LogSleep:
send "\n\nLogin timed out after 2 minutes\n"
gosub logout
goto main
;********************************************************
;Skip junk from the modem
;********************************************************
skip: timeout 3 goto SkipOK
more: wait ""
goto more
SkipOK: timeout 0
return
;********************************************************
;* Log out
;********************************************************
logout: send "\nThanks for calling "$sysname"!\n"
hangup
write $dir"log" $date" Logout: "$name"\n"
cli "delete >nil: "$holdzoo" "$hold"#?"
return
;********************************************************
;* User sleeps
;********************************************************
bibi: send "\n\nLooks like you fell asleep!"
write $dir"log" $date" Sleep disconect\n"
gosub logout
goto main
;********************************************************
;Main menu
;********************************************************
MainMenu:
send "\nMain Command (? for menu): "
input $cmd "\r"
send "\n"
IF $cmd == "?" THEN ascsend $dir"menu0"
IF $cmd == "G" THEN return
IF $cmd == "F" THEN gosub FileMenu
IF $cmd == "B" THEN gosub BullMenu
IF $cmd == "O" THEN gosub page
IF $cmd == "S" THEN gosub sysop
IF $cmd == "C" THEN gosub Comment
IF $cmd == "R" THEN gosub Read
IF $cmd == "E" THEN gosub Enter
IF $cmd == "RE"then gosub Enter
goto MainMenu
;********************************************************
;Chat with SYSOP
;********************************************************
page: send "\nPaging SYSOP...\n"
send "(Press Ctrl-Z to exit from chat)\n"
beep
dtenths 3
beep
dtenths 3
beep
write $dir"log" $date" Paged operator\n"
when "^Z" goto EndChat
chat: input $dummy "\r"
send "\n"
goto chat
EndChat:
dlwhen
send "\n"
return
;********************************************************
;File menu
;********************************************************
FileMenu:
send "\nFile Command (? for menu): "
input $cmd "\r"
send "\n"
IF $cmd == "?" THEN ascsend $dir"menu1"
IF $cmd == "" THEN return
IF $cmd == "Q" THEN return
IF $cmd == "L" THEN gosub ListFiles
IF $cmd == "D" THEN gosub Download
IF $cmd == "U" THEN gosub Upload
IF $cmd == "V" THEN gosub ViewZOO
IF $cmd == "EXT" THEN gosub ExtractZOO
IF $cmd == "ADD" THEN gosub AddFile
IF $cmd == "DEL" THEN gosub Remove
IF $cmd == "DIR" THEN gosub Show
IF $cmd == "GET" THEN gosub GetHold
goto FileMenu
;********************************************************
;List files in download directory
;********************************************************
ListFiles:
send "\n"
cli $list" "$dldir
return
;********************************************************
;Download file
;********************************************************
Download:
send "\nEnter file name: "
input $file "\r"
send "\n"
IF $file == "" THEN return
IF exists $dldir$file THEN goto DownlOK
send "File '"$file"' not found!\n"
return
DownlOK:
send "Select transfer protocol (X,Y,Z): "
input $proto "\r"
send "\n"
IF $proto == "" THEN return
IF $proto == "X" THEN goto XDownload
IF $proto == "Y" THEN goto YDownload
IF $proto == "Z" THEN goto ZDownload
send "Illegal protocol!\n"
goto DownlOK
XDownload:
upload $dldir$file,x
write $dir"log" $date" Downloaded "$file" (Xmodem)\n"
return
YDownload:
upload $dldir$file,y
write $dir"log" $date" Downloaded "$file" (Ymodem)\n"
return
ZDownload:
upload $dldir$file,z
write $dir"log" $date" Downloaded "$file" (Zmodem)\n"
return
;********************************************************
;